3.423 \(\int \frac{1}{(c+\frac{a}{x^2}+\frac{b}{x})^2} \, dx\)

Optimal. Leaf size=150 \[ -\frac{2 \left (6 a^2 c^2-6 a b^2 c+b^4\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \left (b^2-4 a c\right )^{3/2}}+\frac{2 x \left (b^2-3 a c\right )}{c^2 \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}-\frac{b \log \left (a+b x+c x^2\right )}{c^3} \]

[Out]

(2*(b^2 - 3*a*c)*x)/(c^2*(b^2 - 4*a*c)) - (b*x^2)/(c*(b^2 - 4*a*c)) + (x^3*(2*a + b*x))/((b^2 - 4*a*c)*(a + b*
x + c*x^2)) - (2*(b^4 - 6*a*b^2*c + 6*a^2*c^2)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^3*(b^2 - 4*a*c)^(3/2
)) - (b*Log[a + b*x + c*x^2])/c^3

________________________________________________________________________________________

Rubi [A]  time = 0.148108, antiderivative size = 150, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {1340, 738, 800, 634, 618, 206, 628} \[ -\frac{2 \left (6 a^2 c^2-6 a b^2 c+b^4\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \left (b^2-4 a c\right )^{3/2}}+\frac{2 x \left (b^2-3 a c\right )}{c^2 \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}-\frac{b \log \left (a+b x+c x^2\right )}{c^3} \]

Antiderivative was successfully verified.

[In]

Int[(c + a/x^2 + b/x)^(-2),x]

[Out]

(2*(b^2 - 3*a*c)*x)/(c^2*(b^2 - 4*a*c)) - (b*x^2)/(c*(b^2 - 4*a*c)) + (x^3*(2*a + b*x))/((b^2 - 4*a*c)*(a + b*
x + c*x^2)) - (2*(b^4 - 6*a*b^2*c + 6*a^2*c^2)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^3*(b^2 - 4*a*c)^(3/2
)) - (b*Log[a + b*x + c*x^2])/c^3

Rule 1340

Int[((a_) + (c_.)*(x_)^(n2_.) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[x^(2*n*p)*(c + b/x^n + a/x^(2*n))^p,
x] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && LtQ[n, 0] && IntegerQ[p]

Rule 738

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(
d*b - 2*a*e + (2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 -
 4*a*c)), Int[(d + e*x)^(m - 2)*Simp[e*(2*a*e*(m - 1) + b*d*(2*p - m + 4)) - 2*c*d^2*(2*p + 3) + e*(b*e - 2*d*
c)*(m + 2*p + 2)*x, x]*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] &
& NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[p, -1] && GtQ[m, 1] && IntQuadraticQ[a, b, c, d,
 e, m, p, x]

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{1}{\left (c+\frac{a}{x^2}+\frac{b}{x}\right )^2} \, dx &=\int \frac{x^4}{\left (a+b x+c x^2\right )^2} \, dx\\ &=\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{\int \frac{x^2 (6 a+2 b x)}{a+b x+c x^2} \, dx}{-b^2+4 a c}\\ &=\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{\int \left (-\frac{2 \left (b^2-3 a c\right )}{c^2}+\frac{2 b x}{c}+\frac{2 \left (a \left (b^2-3 a c\right )+b \left (b^2-4 a c\right ) x\right )}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx}{-b^2+4 a c}\\ &=\frac{2 \left (b^2-3 a c\right ) x}{c^2 \left (b^2-4 a c\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{2 \int \frac{a \left (b^2-3 a c\right )+b \left (b^2-4 a c\right ) x}{a+b x+c x^2} \, dx}{c^2 \left (b^2-4 a c\right )}\\ &=\frac{2 \left (b^2-3 a c\right ) x}{c^2 \left (b^2-4 a c\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{b \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{c^3}+\frac{\left (b^4-6 a b^2 c+6 a^2 c^2\right ) \int \frac{1}{a+b x+c x^2} \, dx}{c^3 \left (b^2-4 a c\right )}\\ &=\frac{2 \left (b^2-3 a c\right ) x}{c^2 \left (b^2-4 a c\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{b \log \left (a+b x+c x^2\right )}{c^3}-\frac{\left (2 \left (b^4-6 a b^2 c+6 a^2 c^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^3 \left (b^2-4 a c\right )}\\ &=\frac{2 \left (b^2-3 a c\right ) x}{c^2 \left (b^2-4 a c\right )}-\frac{b x^2}{c \left (b^2-4 a c\right )}+\frac{x^3 (2 a+b x)}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{2 \left (b^4-6 a b^2 c+6 a^2 c^2\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \left (b^2-4 a c\right )^{3/2}}-\frac{b \log \left (a+b x+c x^2\right )}{c^3}\\ \end{align*}

Mathematica [A]  time = 0.184312, size = 132, normalized size = 0.88 \[ \frac{-\frac{2 \left (6 a^2 c^2-6 a b^2 c+b^4\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\left (4 a c-b^2\right )^{3/2}}+\frac{a^2 c (3 b-2 c x)-a b^2 (b-4 c x)+b^4 (-x)}{\left (b^2-4 a c\right ) (a+x (b+c x))}-b \log (a+x (b+c x))+c x}{c^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + a/x^2 + b/x)^(-2),x]

[Out]

(c*x + (-(b^4*x) - a*b^2*(b - 4*c*x) + a^2*c*(3*b - 2*c*x))/((b^2 - 4*a*c)*(a + x*(b + c*x))) - (2*(b^4 - 6*a*
b^2*c + 6*a^2*c^2)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/(-b^2 + 4*a*c)^(3/2) - b*Log[a + x*(b + c*x)])/c^3

________________________________________________________________________________________

Maple [B]  time = 0.01, size = 352, normalized size = 2.4 \begin{align*}{\frac{x}{{c}^{2}}}+2\,{\frac{x{a}^{2}}{c \left ( c{x}^{2}+bx+a \right ) \left ( 4\,ac-{b}^{2} \right ) }}-4\,{\frac{xa{b}^{2}}{{c}^{2} \left ( c{x}^{2}+bx+a \right ) \left ( 4\,ac-{b}^{2} \right ) }}+{\frac{x{b}^{4}}{{c}^{3} \left ( c{x}^{2}+bx+a \right ) \left ( 4\,ac-{b}^{2} \right ) }}-3\,{\frac{{a}^{2}b}{{c}^{2} \left ( c{x}^{2}+bx+a \right ) \left ( 4\,ac-{b}^{2} \right ) }}+{\frac{a{b}^{3}}{{c}^{3} \left ( c{x}^{2}+bx+a \right ) \left ( 4\,ac-{b}^{2} \right ) }}-4\,{\frac{\ln \left ( c{x}^{2}+bx+a \right ) ab}{ \left ( 4\,ac-{b}^{2} \right ){c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ){b}^{3}}{{c}^{3} \left ( 4\,ac-{b}^{2} \right ) }}-12\,{\frac{{a}^{2}}{c \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+12\,{\frac{a{b}^{2}}{{c}^{2} \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{{b}^{4}}{{c}^{3} \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(c+a/x^2+b/x)^2,x)

[Out]

x/c^2+2/c/(c*x^2+b*x+a)/(4*a*c-b^2)*x*a^2-4/c^2/(c*x^2+b*x+a)/(4*a*c-b^2)*x*a*b^2+1/c^3/(c*x^2+b*x+a)/(4*a*c-b
^2)*x*b^4-3/c^2/(c*x^2+b*x+a)*b*a^2/(4*a*c-b^2)+1/c^3/(c*x^2+b*x+a)*b^3*a/(4*a*c-b^2)-4/c^2/(4*a*c-b^2)*ln(c*x
^2+b*x+a)*a*b+1/c^3/(4*a*c-b^2)*ln(c*x^2+b*x+a)*b^3-12/c/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))
*a^2+12/c^2/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*b^2-2/c^3/(4*a*c-b^2)^(3/2)*arctan((2*c*x+
b)/(4*a*c-b^2)^(1/2))*b^4

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c+a/x^2+b/x)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.83224, size = 1760, normalized size = 11.73 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c+a/x^2+b/x)^2,x, algorithm="fricas")

[Out]

[-(a*b^5 - 7*a^2*b^3*c + 12*a^3*b*c^2 - (b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*x^3 - (b^5*c - 8*a*b^3*c^2 + 16*a
^2*b*c^3)*x^2 + (a*b^4 - 6*a^2*b^2*c + 6*a^3*c^2 + (b^4*c - 6*a*b^2*c^2 + 6*a^2*c^3)*x^2 + (b^5 - 6*a*b^3*c +
6*a^2*b*c^2)*x)*sqrt(b^2 - 4*a*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x
^2 + b*x + a)) + (b^6 - 9*a*b^4*c + 26*a^2*b^2*c^2 - 24*a^3*c^3)*x + (a*b^5 - 8*a^2*b^3*c + 16*a^3*b*c^2 + (b^
5*c - 8*a*b^3*c^2 + 16*a^2*b*c^3)*x^2 + (b^6 - 8*a*b^4*c + 16*a^2*b^2*c^2)*x)*log(c*x^2 + b*x + a))/(a*b^4*c^3
 - 8*a^2*b^2*c^4 + 16*a^3*c^5 + (b^4*c^4 - 8*a*b^2*c^5 + 16*a^2*c^6)*x^2 + (b^5*c^3 - 8*a*b^3*c^4 + 16*a^2*b*c
^5)*x), -(a*b^5 - 7*a^2*b^3*c + 12*a^3*b*c^2 - (b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*x^3 - (b^5*c - 8*a*b^3*c^2
 + 16*a^2*b*c^3)*x^2 + 2*(a*b^4 - 6*a^2*b^2*c + 6*a^3*c^2 + (b^4*c - 6*a*b^2*c^2 + 6*a^2*c^3)*x^2 + (b^5 - 6*a
*b^3*c + 6*a^2*b*c^2)*x)*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + (b^6 - 9*a
*b^4*c + 26*a^2*b^2*c^2 - 24*a^3*c^3)*x + (a*b^5 - 8*a^2*b^3*c + 16*a^3*b*c^2 + (b^5*c - 8*a*b^3*c^2 + 16*a^2*
b*c^3)*x^2 + (b^6 - 8*a*b^4*c + 16*a^2*b^2*c^2)*x)*log(c*x^2 + b*x + a))/(a*b^4*c^3 - 8*a^2*b^2*c^4 + 16*a^3*c
^5 + (b^4*c^4 - 8*a*b^2*c^5 + 16*a^2*c^6)*x^2 + (b^5*c^3 - 8*a*b^3*c^4 + 16*a^2*b*c^5)*x)]

________________________________________________________________________________________

Sympy [B]  time = 1.60346, size = 842, normalized size = 5.61 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c+a/x**2+b/x)**2,x)

[Out]

(-b/c**3 - sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**2
+ 12*a*b**4*c - b**6)))*log(x + (-10*a**2*b*c - 16*a**2*c**4*(-b/c**3 - sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2
- 6*a*b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 2*a*b**3 + 8*a*b**2*c**
3*(-b/c**3 - sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**
2 + 12*a*b**4*c - b**6))) - b**4*c**2*(-b/c**3 - sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c
**3*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))))/(12*a**2*c**2 - 12*a*b**2*c + 2*b**4)) + (-b/c*
*3 + sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a
*b**4*c - b**6)))*log(x + (-10*a**2*b*c - 16*a**2*c**4*(-b/c**3 + sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*
b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))) + 2*a*b**3 + 8*a*b**2*c**3*(-b/
c**3 + sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c**3*(64*a**3*c**3 - 48*a**2*b**2*c**2 + 12
*a*b**4*c - b**6))) - b**4*c**2*(-b/c**3 + sqrt(-(4*a*c - b**2)**3)*(6*a**2*c**2 - 6*a*b**2*c + b**4)/(c**3*(6
4*a**3*c**3 - 48*a**2*b**2*c**2 + 12*a*b**4*c - b**6))))/(12*a**2*c**2 - 12*a*b**2*c + 2*b**4)) + (-3*a**2*b*c
 + a*b**3 + x*(2*a**2*c**2 - 4*a*b**2*c + b**4))/(4*a**2*c**4 - a*b**2*c**3 + x**2*(4*a*c**5 - b**2*c**4) + x*
(4*a*b*c**4 - b**3*c**3)) + x/c**2

________________________________________________________________________________________

Giac [A]  time = 1.10734, size = 217, normalized size = 1.45 \begin{align*} \frac{2 \,{\left (b^{4} - 6 \, a b^{2} c + 6 \, a^{2} c^{2}\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \sqrt{-b^{2} + 4 \, a c}} + \frac{x}{c^{2}} - \frac{b \log \left (c x^{2} + b x + a\right )}{c^{3}} - \frac{\frac{{\left (b^{4} - 4 \, a b^{2} c + 2 \, a^{2} c^{2}\right )} x}{c} + \frac{a b^{3} - 3 \, a^{2} b c}{c}}{{\left (c x^{2} + b x + a\right )}{\left (b^{2} - 4 \, a c\right )} c^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c+a/x^2+b/x)^2,x, algorithm="giac")

[Out]

2*(b^4 - 6*a*b^2*c + 6*a^2*c^2)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((b^2*c^3 - 4*a*c^4)*sqrt(-b^2 + 4*a*c)
) + x/c^2 - b*log(c*x^2 + b*x + a)/c^3 - ((b^4 - 4*a*b^2*c + 2*a^2*c^2)*x/c + (a*b^3 - 3*a^2*b*c)/c)/((c*x^2 +
 b*x + a)*(b^2 - 4*a*c)*c^2)